import React, { Component } from 'react';
import './App.css';
import Index from './pages/index/Index';
import Login from './pages/login/Login';
import {connect} from 'react-redux';

import zh_CN from 'antd/lib/locale-provider/zh_CN';
import {LocaleProvider} from "antd";


class App extends Component {
  render() {
    return (
        <LocaleProvider locale={zh_CN}>
        <div>
            {this.props.isLogin?<Index/>:<Login/>}
        </div>
        </LocaleProvider>
    )

  }
}

const mapStateToProps = (state) => {
    return {
        isLogin:state.isLogin
    }
};


export default connect(mapStateToProps, null)(App);
